package com.example.weibo_suhuanzhen.retrofit;

import com.example.weibo_suhuanzhen.bean.BaseBean;
import com.example.weibo_suhuanzhen.bean.UserInfo;
import com.example.weibo_suhuanzhen.bean.WeiboInfoPage;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ShzApi {
//    @GET("quick-game/game/{id}")
//    Call<BaseBean<GameBean>> getNameDetail(@Path("id") String id);


    @POST("weibo/api/auth/sendCode")
    Call<BaseBean<Object>> sendMsgCode(@Body PhoneRequest phoneRequest);

    @POST("weibo/api/auth/login")
    Call<LoginResponse> verifyCode(@Body LoginRequest loginRequest);
    @GET("/weibo/api/user/info")
    Call<UserInfoResponse> getUserInfo(@Header("Authorization") String token);

    @GET("weibo/homePage")
    Call<WeiboInfoResponse> getHomePage(@Header("Authorization") String token, @Query("current") int current, @Query("size") int size);

    @POST("/weibo/like/up")
    Call<BaseBean<Boolean>> sendLike(@Header("Authorization") String token ,@Body LikeEventRequest likeEventRequest);

    @POST("/weibo/like/down")
    Call<BaseBean<Boolean>> sendCancelLike(@Header("Authorization") String token ,@Body LikeEventRequest likeEventRequest);

    class PhoneRequest {
        private String phone;

        public PhoneRequest(String phone) {
            this.phone = phone;
        }

        // Getter and Setter
        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }
    }

    class LoginRequest {
        private String phone;
        private String smsCode;

        public LoginRequest(String phone, String smsCode) {
            this.phone = phone;
            this.smsCode = smsCode;
        }

        // Getter and Setter
        public String getPhone() {
            return phone;
        }

        public void setPhone(String phone) {
            this.phone = phone;
        }

        public String getSmsCode() {
            return smsCode;
        }

        public void setSmsCode(String smsCode) {
            this.smsCode = smsCode;
        }
    }
    class ApiResponse {
        private int code;
        private String msg;
        private boolean data;



        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public boolean isData() {
            return data;
        }

        public void setData(boolean data) {
            this.data = data;
        }
    }

    class LoginResponse {
        private int code;
        private String msg;
        private String data; // token



        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public String getData() {
            return data;
        }

        public void setData(String data) {
            this.data = data;
        }
    }
    class UserInfoResponse {
        private int code;
        private String msg;
        private UserInfo data;



        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public UserInfo getData() {
            return data;
        }

        public void setData(UserInfo data) {
            this.data = data;
        }
    }

    class WeiboInfoResponse {
        private int code;
        private String msg;
        private WeiboInfoPage data;



        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public WeiboInfoPage getData() {
            return data;
        }

        public void setData(WeiboInfoPage data) {
            this.data = data;
        }
    }

    class LikeEventRequest {
        private Long id;

        public LikeEventRequest(Long id) {
            this.id = id;
        }

        public Long getId() {
            return id;
        }

        public void setId(Long id) {
            this.id = id;
        }
    }

}